// https://leetcode.cn/problems/matrix-similarity-after-cyclic-shifts/description/


func areSimilar(mat [][]int, k int) bool {
    m := len(mat)
	n := len(mat[0])
	var next int
	for i := 0; i < n; i++ {
		if i & 1 == 0 {
			next = (i + k) % n
		} else {
			next = (i - k) % n
		}
		fmt.Println("i->", i, "next->", next)
		for j := 0; j < m; j++ {
			if mat[j][i] != mat[j][next] {
				return false
			}
		}
	}
	return true
}